package com.logistics.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.logistics.dto.DispatchArrivalDTO;
import com.logistics.dto.DispatchConfirmDTO;
import com.logistics.dto.DispatchQueryDTO;
import com.logistics.entity.DispatchRecord;
import com.logistics.vo.DispatchVO;

import java.util.List;

/**
 * 发车记录服务接口
 */
public interface DispatchRecordService extends IService<DispatchRecord> {
    
    /**
     * 分页查询发车记录
     */
    Page<DispatchVO> getDispatchPage(DispatchQueryDTO query);
    
    /**
     * 创建发车记录
     */
    DispatchRecord createDispatch(Long vehicleId, Long departureSiteId, String departureSiteName, 
                                 Long arrivalSiteId, String arrivalSiteName, String remark);
    
    /**
     * 为临时车辆创建发车记录
     */
    DispatchRecord createTempDispatch(String vehiclePlate, String vehicleType, 
                                     Long departureSiteId, String departureSiteName,
                                     Long arrivalSiteId, String arrivalSiteName,
                                     String driverName, String driverPhone, String remark);
    
    /**
     * 确认发车
     */
    void confirmDispatch(DispatchConfirmDTO dto);
    
    /**
     * 确认到达
     */
    void confirmArrival(DispatchArrivalDTO dto);
    
    /**
     * 删除发车记录（物理删除，仅待发车状态）
     */
    void deleteDispatch(Long dispatchId);
    
    /**
     * 取消发车（状态变更，仅已发车状态）
     */
    void cancelDispatch(Long dispatchId, String cancelReason);
    
    /**
     * 根据车辆ID获取订单列表
     */
    List<?> getVehicleOrders(Long vehicleId);
}
